class DefaultConfig(object):
    HOSTNAME = 'localhost'
    PORT = '3307'
    DATABASE = 'equipment_inspection'
    USERNAME = 'root'
    PASSWORD = 'root' 

    # 修复SQLAlchemy配置缺失问题
    SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8mb4"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    SECRET_KEY = 'your-secret-key'
    JWT_SECRET_KEY = 'your-jwt-secret-key'
    # 静态文件路径配置
    STATIC_FOLDER = 'static'
    STATIC_URL_PATH = '/static'
    UPLOAD_FOLDER = 'static/uploads'
    JWT_ACCESS_TOKEN_EXPIRES = 30 * 24 * 60 * 60  # 设置为30天（以秒为单位） 


class ProductionConfig(DefaultConfig):
    HOSTNAME = 'localhost'
    PORT = '3306'
    DATABASE = 'equipment_inspection'
    USERNAME = 'root'
    PASSWORD = 'root' 

    SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8mb4"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    SECRET_KEY = 'your-secret-key'
    JWT_SECRET_KEY = 'your-jwt-secret-key'
    # 静态文件路径配置
    STATIC_FOLDER = 'static'
    STATIC_URL_PATH = '/static'
    UPLOAD_FOLDER = 'static/uploads'
    JWT_ACCESS_TOKEN_EXPIRES = 30 * 24 * 60 * 60  # 设置为30天（以秒为单位）  
